﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsFormsApplication1
{
    class Queen
    {
        private Worker[] workers;
        private int shiftNumber = 0;

        public Queen(Worker[] workers)
        {
            this.workers = workers;
        }

        public bool AssignWork(string job, int numberOfShifts)
        {
            bool jobAssigned = false;
            for(int i = 0; i < workers.Length; i++)
            {
                jobAssigned = workers[i].DoThisJob(job);
                if(jobAssigned)
                    break;                
            }

            if(jobAssigned) // if work gets assigned return true; else false
            return true;
            else
            return false;
        }

        public string WorkTheNextShift()
        {
            shiftNumber++;
            string shiftReport = "Report for shift #" + shiftNumber.ToString() + "\r\n";

            for(int i = 0; i < workers.Length; i++)
            {
                if (workers[i].WorkOneShift())
                    shiftReport += "Worker #" + (i + 1) + " finished the job\r\n";

            }
            return "";
        }


    }
}
